package com.xrx.webtemplate.web.api.impl;

import com.xrx.webtemplate.model.ShiroSessionModel;
import com.xrx.webtemplate.web.api.TokenApi;
import com.xrx.webtemplate.web.service.biz.TokenApiBiz;
import org.apache.shiro.session.Session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.Collection;

/**
 * Created by xierongxian on 2017/4/24.
 */
@Service("tokenApiImpl")
public class TokenApiImpl implements TokenApi {

    @Autowired
    private TokenApiBiz tokenApiBiz;

    public void saveSession(ShiroSessionModel shiroSessionModel) {
        tokenApiBiz.saveSession(shiroSessionModel);
    }

    public void updateSession(ShiroSessionModel shiroSessionModel) {
        tokenApiBiz.updateSession(shiroSessionModel);
    }

    public void refreshSession(String sessionId) {
        tokenApiBiz.refreshSession(sessionId);

    }

    public void deleteSession(String sessionId) {
        tokenApiBiz.deleteSession(sessionId);
    }

    public ShiroSessionModel getSession(String sessionId ) {
        return tokenApiBiz.getSession(sessionId);
    }

    public Collection<Session> getAllSessions() {
        return null;
    }
}
